﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ERPStudio;
using System.Data.SqlClient;

namespace Fares
{
    public partial class NoteContabileFrm : FrmRezumat
    {
        public NoteContabileFrm(ModuleClass mc): base(mc)
        {
            InitializeComponent();
            workConnString = mc.workConnectionString;
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont articol", "{ART.CNT}"));
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont TVA deductibil", "{TVA.DED}"));
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont TVA colectat", "{TVA.COL}"));
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont client", "{PRT.CCL}"));
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont furnizor", "{PRT.CNT}"));
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont articol cheltuiala", "{ART.CLT}"));
            contDebitBindingSource.Add(new TipOperatiunePlata("Cont articol venit", "{ART.VEN}"));

            contCreditBindingSource.Add(new TipOperatiunePlata("Cont articol", "{ART.CNT}"));
            contCreditBindingSource.Add(new TipOperatiunePlata("Cont TVA deductibil", "{TVA.DED}"));
            contCreditBindingSource.Add(new TipOperatiunePlata("Cont TVA colectat", "{TVA.COL}"));
            contCreditBindingSource.Add(new TipOperatiunePlata("Cont client", "{PRT.CCL}"));
            contCreditBindingSource.Add(new TipOperatiunePlata("Cont furnizor", "{PRT.CNT}"));
            contCreditBindingSource.Add(new TipOperatiunePlata("Cont articol cheltuiala", "{ART.CLT}"));
            contCreditBindingSource.Add(new TipOperatiunePlata("Cont articol venit", "{ART.VEN}"));

            valoareBindingSource.Add(new TipOperatiunePlata("Valoare", "{DOC.VAL}"));
            valoareBindingSource.Add(new TipOperatiunePlata("TVA", "{DOC.TVA}"));
            valoareBindingSource.Add(new TipOperatiunePlata("Valoare fara TVA", "{DOC.VFTVA}"));
            valoareBindingSource.Add(new TipOperatiunePlata("Pret vanzare amanunt", "{DOC.PVA}"));
            valoareBindingSource.Add(new TipOperatiunePlata("Pret vnz. amt.-TVA", "{DOC.PVAVAL}"));
            valoareBindingSource.Add(new TipOperatiunePlata("Pret vanz. amt.-TVA -val. init", "{DOC.PVAADS}"));
           
        }

        private void NoteContabileFrm_Load(object sender, EventArgs e)
        {
            SqlConnection con = DeschideConexiune(workConnString);
            this.fares_TipDocumentTableAdapter.Connection = con;
            this.fares_TipDocumentTableAdapter.Fill(this.eSRPDataSet.fares_TipDocument);

            //this.tipDocumentTableAdapter.Connection = con;
            //this.tipDocumentTableAdapter.Fill(this.eSRPDataSet.TipDocument);

            this.genNoteContabileTableAdapter.Connection = con;
            this.genNoteContabileTableAdapter.Fill(this.eSRPDataSet.GenNoteContabile);
            InchideConexiune(con);
            AddBindingSource(genNoteContabileBindingSource);
            this.listTableAdaptor.Add(this.genNoteContabileTableAdapter.Adapter);

            HandleSalvare += Salvare;

        }
    }
}
